package com.jhhc.Http;

import com.jhhc.Http.ServiceImpl.GetUrlServiceImpl;

import java.time.LocalDateTime;
import java.util.Timer;
import java.util.TimerTask;

public class WaitForInsertHxData {


    public static void main(String[] args) {
        GetUrlServiceImpl getUrlService = new GetUrlServiceImpl();
        //
        TimerTask timerTask = new TimerTask() {
            @Override
            public void run() {
                try {
                    //水库入库方法·
                    getUrlService.getRSVRdata();
                    //雨量入库方法
                    getUrlService.getPPTNdata();
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        };
        // 在指定延迟0毫秒后开始，随后地执行以2000毫秒间隔执行timerTask
        new Timer().schedule(timerTask, 0L, 3600000L);
        System.out.println("当前线程：" + Thread.currentThread().getName() + " 当前时间" + LocalDateTime.now());
    }



}
